package net.togogo.bean;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;
import java.util.Map;

//将配置文件中的每一个属性值 映射到这个组件中
//@ConfigurationProperties 告诉springboot将本类中所有属性与配置文件中的值进行绑定
//prefix = "user" 将匹配到的配置文件内值与类进行对应
//这是一个容器 @ConfigurationProperties
@Component
@ConfigurationProperties(prefix = "user")
public class User {
    private Integer id;
    private String f_name;
    private Boolean stu;
    private Date birth;
    private String sex;

    private Map<String,Object> maps;
    private List<Object> lists;

    private Cat cat;

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", f_name='" + f_name + '\'' +
                ", stu=" + stu +
                ", birth=" + birth +
                ", sex='" + sex + '\'' +
                ", maps=" + maps +
                ", lists=" + lists +
                ", cat=" + cat +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getF_name() {
        return f_name;
    }

    public void setF_name(String f_name) {
        this.f_name = f_name;
    }

    public Boolean getStu() {
        return stu;
    }

    public void setStu(Boolean stu) {
        this.stu = stu;
    }

    public Date getBirth() {
        return birth;
    }

    public void setBirth(Date birth) {
        this.birth = birth;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public Map<String, Object> getMaps() {
        return maps;
    }

    public void setMaps(Map<String, Object> maps) {
        this.maps = maps;
    }

    public List<Object> getLists() {
        return lists;
    }

    public void setLists(List<Object> lists) {
        this.lists = lists;
    }

    public Cat getCat() {
        return cat;
    }

    public void setCat(Cat cat) {
        this.cat = cat;
    }
}
